Move tab UI helpers into view layer and remove unused models#1161
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR removes several files and refactors navigation and menu wiring: deletes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 3/5 reviews remaining, refill in 16 minutes and 36 seconds. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
lib/view/page/home_tab.dart (1)
32-36: 💤 Low valueSnippet tab uses the same icon for both selected and unselected states.
Unlike other tabs which use distinct icons (e.g.,
bx_server/bxs_server,terminal_outlined/terminal,folder_open/folder), the snippet tab usesIcons.codefor both states. Consider usingIcons.code_outlinedor similar for the unselected state to maintain visual consistency.♻️ Suggested fix
AppTab.snippet => NavigationDestination( - icon: const Icon(Icons.code), + icon: const Icon(Icons.code_outlined), label: libL10n.snippet, selectedIcon: const Icon(Icons.code), ),Apply the same change to
navRailDestinationat lines 57-61.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/view/page/home_tab.dart` around lines 32 - 36, AppTab.snippet's NavigationDestination uses the same Icon(Icons.code) for both selected and unselected states; change the unselected icon to a distinct outlined variant (e.g., Icons.code_outlined) in the NavigationDestination for AppTab.snippet and make the same change in the corresponding navRailDestination block so the unselected/selected icons mirror the pattern used by other tabs.lib/view/page/home.dart (1)
163-170: 💤 Low valueConsider passing
_onDestinationSelecteddirectly.The wrapper callback is unnecessary since
_onDestinationSelectedalready matches the expectedvoid Function(int)signature.♻️ Suggested simplification
if (Platform.isMacOS) { return PlatformMenuBar( - menus: MacOSMenuBarManager.buildMenuBar(context, (int index) { - _onDestinationSelected(index); - }), + menus: MacOSMenuBarManager.buildMenuBar(context, _onDestinationSelected), child: mainContent, ); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/view/page/home.dart` around lines 163 - 170, The anonymous wrapper around _onDestinationSelected is redundant; update the PlatformMenuBar call to pass the function directly by replacing the inline closure in MacOSMenuBarManager.buildMenuBar with _onDestinationSelected (which already matches void Function(int)), leaving PlatformMenuBar and mainContent unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@lib/view/page/home_tab.dart`:
- Around line 32-36: AppTab.snippet's NavigationDestination uses the same
Icon(Icons.code) for both selected and unselected states; change the unselected
icon to a distinct outlined variant (e.g., Icons.code_outlined) in the
NavigationDestination for AppTab.snippet and make the same change in the
corresponding navRailDestination block so the unselected/selected icons mirror
the pattern used by other tabs.
In `@lib/view/page/home.dart`:
- Around line 163-170: The anonymous wrapper around _onDestinationSelected is
redundant; update the PlatformMenuBar call to pass the function directly by
replacing the inline closure in MacOSMenuBarManager.buildMenuBar with
_onDestinationSelected (which already matches void Function(int)), leaving
PlatformMenuBar and mainContent unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 260e1a8e-d344-4cc6-a180-51a9ad9ec71e
📒 Files selected for processing (9)
lib/data/model/app/tab.dartlib/data/model/pkg/manager.dartlib/data/provider/providers.dartlib/view/page/home.dartlib/view/page/home_tab.dartlib/view/page/macos_menu_bar.dartlib/view/page/ping.dartlib/view/page/setting/entries/home_tabs.dartlib/view/page/snippet/result.dart
💤 Files with no reviewable changes (4)
- lib/view/page/ping.dart
- lib/data/model/pkg/manager.dart
- lib/data/provider/providers.dart
- lib/view/page/snippet/result.dart
Summary
AppTabpage and navigation helper logic out of the model intoview/page/home_tab.dartAppTabparsing and keep the enum focused on stored values onlyTesting
Summary by CodeRabbit
Removed Features
User Interface
Chores